import Vue from "vue";
import VueRouter from "vue-router";
import Movie from "../components/Movie.vue";
import Synopsis from "../views/Synopsis.vue";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "Movie",
    component: Movie,
    redirect: "/public_praise",
    children: [
      {
        path: "/public_praise",
        name: "Public_praise",
        component: () => import("../views/Public_praise.vue"),
      },
      {
        path: "/expectation",
        name: "Expectation",
        component: () => import("../views/Expectation.vue"),
      },
      {
        path: "/box_office",
        name: "Box_office",
        component: () => import("../views/Box_office.vue"),
      },
      {
        path: "/synopsis/:region/:title/:images/:type/:timer/:release/:office/:names/:score",
        name: "Synopsis",
        components: {
          default:Synopsis,
          Synopsis:Synopsis
        },
      },
    ],
  },
];

const router = new VueRouter({
  routes,
  mode: "history",
});

export default router;
